home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 June / macformat-038.iso / Demos / Interactive Wave / _DATAS / SHARED.Dxr / 00970_Gestion du Moteur MCD.ls < prev    next >
Encoding:
Text File  |  1995-08-06  |  12.4 KB  |  448 lines

  1. on GestAvantMCD
  2.   global listMCD
  3.   set NumTitre to getAt(listMCD, 1) + 1
  4.   if NumTitre > getAt(listMCD, 6) then
  5.     set NumTitre to 1
  6.   end if
  7.   SetNumTitreMCD(NumTitre)
  8.   InitTitreMCD()
  9. end
  10.  
  11. on GestArriereMCD
  12.   global listMCD
  13.   set NumTitre to getAt(listMCD, 1) - 1
  14.   if NumTitre < 1 then
  15.     set NumTitre to getAt(listMCD, 6)
  16.   end if
  17.   SetNumTitreMCD(NumTitre)
  18.   InitTitreMCD()
  19. end
  20.  
  21. on ClicSurTitreMCD NumTitre
  22.   PlayClick()
  23.   AffMessAttente()
  24.   SetNumTitreMCD(NumTitre)
  25.   SetDcRollOver()
  26.   SetDcRollCast()
  27.   FalseReste()
  28.   GoFrame("DebTitre")
  29. end
  30.  
  31. on ClicSurEtatMCD NumEtat
  32.   PlayClick()
  33.   ForceEtatMCD(NumEtat)
  34. end
  35.  
  36. on ForceEtatMCD NumEtat
  37.   AffMessAttente()
  38.   SetEtatTitreMCD(NumEtat)
  39.   AffRubMCD()
  40. end
  41.  
  42. on InitMCD
  43.   puppetTempo(60)
  44.   RecupListMCD()
  45.   SetMacroEnd("MacroEndMCD")
  46. end
  47.  
  48. on ChoixSonMCD Op
  49.   global listMCD
  50.   if getAt(listMCD, 3) = "CDACTU" then
  51.     set AccuC to "CDA_BCLC  CDA_BCLE  CDA_BCLL  CDA_BCLU"
  52.   else
  53.     set AccuC to "CDJEBCL1.AIF CDJEBCL2.AIF CDJEBCL3.AIF"
  54.   end if
  55.   set Fichier to word random(the number of words in AccuC) of AccuC
  56.   if paramCount() <> 0 then
  57.     PlaySoundTest(1, "Puppet", Fichier)
  58.   end if
  59.   KeepSound(1, "Puppet", Fichier)
  60. end
  61.  
  62. on InitAnimMCD Op
  63.   global listMCD, MacroFrameAsk
  64.   AffMessAttente()
  65.   InitListMCD()
  66.   if getAt(listMCD, 3) = "CDACTU" then
  67.     InitBarrette("010")
  68.   end if
  69.   set ParaPuce to getAt(listMCD, 3) & " DebSom NAVIG #"
  70.   SetMemoNavPuce(ParaPuce, 0)
  71.   set MacroFrameAsk to EMPTY
  72.   if getAt(listMCD, 3) = "CDJEUX" then
  73.     SkipMCD()
  74.   end if
  75. end
  76.  
  77. on SkipMCD
  78.   set Para to getAt(listMCD, 3) & " DebSom QTspriteEfface(1)"
  79.   ActiveSkip(Para)
  80. end
  81.  
  82. on InitSomMCD
  83.   global listMCD
  84.   ChoixSonMCD(1)
  85.   InitBarrette("010")
  86.   AffMessAttente()
  87.   DesactiveSkip()
  88.   ActiveScrSaver()
  89.   set ParaPuce to getAt(listMCD, 3) & " DebSom NAVIG #"
  90.   SetMemoNavPuce(ParaPuce, 0)
  91.   UnLoadCastTitreMCD()
  92.   puppetSprite(4, 1)
  93.   if the number of cast "C2_TitreM2" <> -1 then
  94.     set Champs to "11 C1_TitreM1 C2_TitreM1 R_Cliquez 12 C1_TitreM2 C2_TitreM2 R_Cliquez 13 C1_TitreM3 C2_TitreM3 R_Cliquez 14 C1_TitreM4 C2_TitreM4 R_Cliquez 15 C1_TitreM5 C2_TitreM5 R_Cliquez 16 C1_TitreM6 C2_TitreM6 R_Cliquez 17 C1_TitreM7 C2_TitreM7 R_Cliquez 18 C1_TitreM8 C2_TitreM8 R_Cliquez 19 C1_TitreM9 C2_TitreM9 R_Cliquez 20 C1_TitreM10 C2_TitreM10 R_Cliquez "
  95.     InitRollGen(Champs)
  96.     set Champs to "EffPictTitreMCD C2_TitreM1 1 AffPictTitreMCD(1) C2_TitreM2 1 AffPictTitreMCD(2) C2_TitreM3 1 AffPictTitreMCD(3) C2_TitreM4 1 AffPictTitreMCD(4) C2_TitreM5 1 AffPictTitreMCD(5) C2_TitreM6 1 AffPictTitreMCD(6) C2_TitreM7 1 AffPictTitreMCD(7) C2_TitreM8 1 AffPictTitreMCD(8) C2_TitreM9 1 AffPictTitreMCD(9) C2_TitreM10 1 AffPictTitreMCD(10) "
  97.     InitRollCast(Champs)
  98.   else
  99.     set Champs to "ClicSurTitreMCD(1) R_Cliquez ClicSurTitreMCD(2) R_Cliquez ClicSurTitreMCD(3) R_Cliquez ClicSurTitreMCD(4) R_Cliquez ClicSurTitreMCD(5) R_Cliquez ClicSurTitreMCD(6) R_Cliquez ClicSurTitreMCD(7) R_Cliquez ClicSurTitreMCD(8) R_Cliquez ClicSurTitreMCD(9) R_Cliquez ClicSurTitreMCD(10) R_Cliquez"
  100.     InitRollCadre(25, "RollCD", 1, getAt(listMCD, 6), 210, 31, 0, 0, Champs)
  101.   end if
  102. end
  103.  
  104. on InitTitreDebMCD
  105.   global MacroFrameAsk
  106.   InitBarrette("111")
  107.   AffMessAttente()
  108.   PutEtatSprite(1, "04_05_10")
  109.   if (MacroFrameAsk <> EMPTY) and (voidp(MacroFrameAsk) = 0) then
  110.     set NumTitre to value(MacroFrameAsk)
  111.     SetNumTitreMCD(NumTitre)
  112.     set MacroFrameAsk to EMPTY
  113.   end if
  114.   EffaceVideoMCD()
  115.   UnLoadCastPetitQTMCD()
  116.   UnLoadCastSomMCD()
  117.   InitTitreMCD()
  118. end
  119.  
  120. on InitTitreMCD
  121.   global listMCD
  122.   AffMessAttente()
  123.   ActiveScrSaver()
  124.   if getAt(listMCD, 3) = "CDJEUX" then
  125.     SetEtatTitreMCD(2)
  126.   else
  127.     SetEtatTitreMCD(1)
  128.   end if
  129.   set NomAnim to getAt(listMCD, 3)
  130.   set ParaPuce to NomAnim & " DebTitre#" & string(getAt(listMCD, 1)) & " " & NomAnim & " DebSom"
  131.   SetMemoNavPuce(ParaPuce)
  132.   set ParaPuce to NomAnim & " DebTitre " & NomAnim & " DebSom  PuceTitreMCD"
  133.   SetMemoNavPuce(ParaPuce, 0)
  134.   set the castNum of sprite 5 to getAt(listMCD, 5) + getAt(listMCD, 1)
  135.   if getAt(listMCD, 3) <> "CDJEUX" then
  136.     AffPictTitreMCD(getAt(listMCD, 1))
  137.   end if
  138.   AffRubMCD()
  139.   UnLoadCastTitreSeulMCD()
  140.   PlayVoixOffMCD()
  141. end
  142.  
  143. on PuceTitreMCD
  144.   EffaceVideoMCD()
  145.   Cson(1)
  146. end
  147.  
  148. on AffRubMCD
  149.   global listMCD, CastEfface, listFichSound
  150.   if getAt(listMCD, 10) = 3 then
  151.     EffaceVideoMCD()
  152.   end if
  153.   set NomMacro to word getAt(listMCD, 2) of "AffAvisMCD AffVisiteMCD AffOeilMCD AffInfoMCD"
  154.   if (getAt(listMCD, 3) = "CDACTU") and (NomMacro <> "AffInfoMCD") then
  155.     if (getAt(listFichSound, 3) <> ("CD_S" & string(getAt(listMCD, 1)))) and (soundBusy(1) <> 0) then
  156.       Cson(1)
  157.     end if
  158.   end if
  159.   DiaporamaOff()
  160.   set the castNum of sprite 6 to CastEfface
  161.   set the castNum of sprite 7 to CastEfface
  162.   set the castNum of sprite 8 to CastEfface
  163.   updateStage()
  164.   AnnuleMacroVar()
  165.   do(NomMacro)
  166.   updateStage()
  167.   UnLoadCastTitreCibleMCD()
  168.   RestoreCursor()
  169. end
  170.  
  171. on AffAvisMCD
  172.   global listMCD
  173.   set Champs to "11 B2_Avis B3_Avis R_EnCours 12 B1_Visite B3_Visite R_Cliquez 14 B1_Info B3_Info R_Cliquez"
  174.   InitRollGen(Champs)
  175.   set Champs to "13 B1_Oeil B3_Oeil R_Cliquez"
  176.   GestSiRollOeilMCD(Champs)
  177.   puppetSprite(6, 1)
  178.   set the castNum of sprite 6 to getAt(listMCD, 7) + getAt(listMCD, 1)
  179. end
  180.  
  181. on PlayVoixOffMCD
  182.   global listMCD, CheminDisk
  183.   if word getAt(listMCD, 1) * 2 of the text of cast "ChampsVoixOff" = "N" then
  184.     return ChoixSonMCD()
  185.   end if
  186.   set Fichier to CheminDisk & ":_" & getAt(listMCD, 3) & ":CDSONS:CD_S" & string(getAt(listMCD, 1))
  187.   PlaySound(1, "PLAY", Fichier)
  188.   ChoixSonMCD()
  189.   updateStage()
  190. end
  191.  
  192. on AffVisiteMCD
  193.   global listMCD, CheminDisk
  194.   set Champs to "11 B1_Avis B3_Avis R_Cliquez 12 B2_Visite B3_Visite R_EnCours 14 B1_Info B3_Info R_Cliquez"
  195.   InitRollGen(Champs)
  196.   set Champs to "13 B1_Oeil B3_Oeil R_Cliquez"
  197.   GestSiRollOeilMCD(Champs)
  198.   set NumTitre to string(getAt(listMCD, 1))
  199.   set NomFichier to CheminDisk & ":_" & getAt(listMCD, 3) & ":CD_DIA:CD_SV0" & NumTitre
  200.   set ParaSound to the text of cast ("Diapo" & NumTitre)
  201.   SetDiaporama(1, "Play", NomFichier, 255, 7, ParaSound, 0)
  202. end
  203.  
  204. on AffOeilMCD
  205.   global listMCD
  206.   set NomCast to "Video" & string(getAt(listMCD, 1))
  207.   if the number of cast NomCast = -1 then
  208.     return AffAvisMCD()
  209.   end if
  210.   set Champs to "11 B1_Avis B3_Avis R_Cliquez 12 B1_Visite B3_Visite R_Cliquez 14 B1_Info B3_Info R_Cliquez"
  211.   InitRollGen(Champs)
  212.   set Champs to "13 B2_Oeil B3_Oeil R_Cliquez"
  213.   GestSiRollOeilMCD(Champs)
  214.   set the locH of sprite 10 to the locH of sprite 1
  215.   set the locV of sprite 10 to the locV of sprite 1
  216.   QTspriteStart([10, NomCast, 0, 1, 255, 1, 1, 0, 1, 0, 1, 0, 0, 0])
  217.   updateStage()
  218.   QTspriteStart([10, #auto, 1, 1])
  219.   SetDcMacroVar("ScruteQTMCD")
  220. end
  221.  
  222. on ScruteQTMCD
  223.   if the movieRate of sprite 10 = 0 then
  224.     ForceEtatMCD(1)
  225.   end if
  226. end
  227.  
  228. on GestSiRollOeilMCD Champs
  229.   global listMCD
  230.   set NumCastVideo to the number of cast ("Video" & string(getAt(listMCD, 1)))
  231.   if NumCastVideo = -1 then
  232.     set Champs to "13 CastFactice CastFactice R_Cliquez"
  233.   end if
  234.   AjouteRollGen(Champs)
  235. end
  236.  
  237. on AffInfoMCD
  238.   global listMCD
  239.   set Champs to "11 B1_Avis B3_Avis R_Cliquez 12 B1_Visite B3_Visite R_Cliquez 14 B2_Info B3_Info R_EnCours"
  240.   InitRollGen(Champs)
  241.   set Champs to "13 B1_Oeil B3_Oeil R_Cliquez"
  242.   GestSiRollOeilMCD(Champs)
  243.   puppetSprite(8, 1)
  244.   set the castNum of sprite 8 to getAt(listMCD, 8) + getAt(listMCD, 1)
  245. end
  246.  
  247. on EffPictTitreMCD
  248.   global CastEfface
  249.   set the castNum of sprite 4 to CastEfface
  250. end
  251.  
  252. on AffPictTitreMCD NumTitre
  253.   global listMCD
  254.   set the castNum of sprite 4 to getAt(listMCD, 4) + NumTitre
  255.   updateStage()
  256. end
  257.  
  258. on EffaceVideoMCD
  259.   QTspriteEfface(10)
  260. end
  261.  
  262. on SetNumTitreMCD NumTitre
  263.   global listMCD
  264.   setAt(listMCD, 9, getAt(listMCD, 1))
  265.   setAt(listMCD, 1, NumTitre)
  266. end
  267.  
  268. on SetEtatTitreMCD NumEtat
  269.   global listMCD
  270.   setAt(listMCD, 10, getAt(listMCD, 2))
  271.   setAt(listMCD, 2, NumEtat)
  272. end
  273.  
  274. on InitListMCD
  275.   global listMCD
  276.   set listMCD to list(1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0)
  277.   set NomAnim to MakeNomPropre(the movie)
  278.   set NomAnim to chars(NomAnim, 1, length(NomAnim) - 4)
  279.   setAt(listMCD, 3, NomAnim)
  280.   setAt(listMCD, 4, the number of cast "PictTitre1" - 1)
  281.   setAt(listMCD, 5, the number of cast "Titre1" - 1)
  282.   repeat with compt = 1 to 10
  283.     set LimitCast to compt
  284.     if the number of cast ("Titre" & string(compt)) = -1 then
  285.       set LimitCast to compt - 1
  286.       exit repeat
  287.     end if
  288.   end repeat
  289.   setAt(listMCD, 6, LimitCast)
  290.   setAt(listMCD, 7, the number of cast "Avis1" - 1)
  291.   setAt(listMCD, 8, the number of cast "Info1" - 1)
  292.   setAt(listMCD, 11, the number of cast "CastRef1")
  293.   setAt(listMCD, 12, the number of cast "CastRef2")
  294. end
  295.  
  296. on RecupListMCD
  297.   set NomAnim to MakeNomPropre(the movie)
  298.   set NomAnim to chars(NomAnim, 1, length(NomAnim) - 4)
  299.   set NomMacro to "RecupList" & NomAnim
  300.   do(NomMacro)
  301. end
  302.  
  303. on SauveListMCD
  304.   set NomAnim to MakeNomPropre(the movie)
  305.   set NomAnim to chars(NomAnim, 1, length(NomAnim) - 4)
  306.   set NomMacro to "SauveList" & NomAnim
  307.   do(NomMacro)
  308. end
  309.  
  310. on RecupListCDACTU
  311.   global listMCD, listCDactu
  312.   if voidp(listCDactu) or (listCDactu = list()) then
  313.     return InitListMCD()
  314.   end if
  315.   set listMCD to listCDactu
  316.   set listCDactu to list()
  317. end
  318.  
  319. on SauveListCDACTU
  320.   global listMCD, listCDactu
  321.   set listCDactu to listMCD
  322.   set listMCD to list()
  323. end
  324.  
  325. on RecupListCDJEUX
  326.   global listMCD, listCDjeux
  327.   if voidp(listCDjeux) or (listCDjeux = list()) then
  328.     return InitListMCD()
  329.   end if
  330.   set listMCD to listCDjeux
  331.   set listCDjeux to list()
  332. end
  333.  
  334. on SauveListCDJEUX
  335.   global listMCD, listCDjeux
  336.   set listCDjeux to listMCD
  337.   set listMCD to list()
  338. end
  339.  
  340. on RecupListCDKIDS
  341.   global listMCD, listCDkids
  342.   if voidp(listCDkids) or (listCDkids = list()) then
  343.     return InitListMCD()
  344.   end if
  345.   set listMCD to listCDkids
  346.   set listCDkids to list()
  347. end
  348.  
  349. on SauveListCDKIDS
  350.   global listMCD, listCDkids
  351.   set listCDkids to listMCD
  352.   set listMCD to list()
  353. end
  354.  
  355. on MacroEndMCD
  356.   SauveListMCD()
  357.   Cson()
  358. end
  359.  
  360. on UnLoadCastSomMCD
  361.   global listMCD
  362.   AffMessAttente()
  363.   unLoadCast(81)
  364.   set CastDeb to getAt(listMCD, 11) + 1
  365.   unLoadCast(CastDeb, CastDeb + 9)
  366.   unLoadCast(CastDeb + 10, CastDeb + 19)
  367.   unLoadCast(CastDeb + 20, CastDeb + 29)
  368.   RestoreCursor()
  369. end
  370.  
  371. on UnLoadCastTitreMCD
  372.   global listMCD
  373.   AffMessAttente()
  374.   UnLoadCastPetitQTMCD()
  375.   unLoadCast(71, 79)
  376.   unLoadCast(82)
  377.   set CastDeb to getAt(listMCD, 11) + 1
  378.   unLoadCast(CastDeb + 20, CastDeb + 29)
  379.   unLoadCast(CastDeb + 30, CastDeb + 39)
  380.   unLoadCast(CastDeb + 40, CastDeb + 49)
  381.   unLoadCast(CastDeb + 50, CastDeb + 59)
  382.   set CastDeb to getAt(listMCD, 12) + 1
  383.   unLoadCast(CastDeb, CastDeb + 11)
  384.   unLoadCast(171, 300)
  385.   RestoreCursor()
  386. end
  387.  
  388. on UnLoadCastTitreCibleMCD
  389.   global listMCD
  390.   set CastDeb to getAt(listMCD, 11)
  391.   set LastCast to getAt(listMCD, 9)
  392.   unLoadCast(CastDeb + 40 + LastCast)
  393.   if getAt(listMCD, 10) = 2 then
  394.     unLoadCast(171, 300)
  395.   end if
  396.   unLoadCast(70 + LastCast)
  397.   unLoadCast(CastDeb + 50 + LastCast)
  398. end
  399.  
  400. on UnLoadCastTitreSeulMCD
  401.   global listMCD
  402.   unLoadCast(getAt(listMCD, 11) + 20 + getAt(listMCD, 9))
  403.   unLoadCast(getAt(listMCD, 11) + 30 + getAt(listMCD, 9))
  404. end
  405.  
  406. on UnLoadCastPetitQTMCD
  407.   unLoadCast(the number of cast "PTIQUICK")
  408. end
  409.  
  410. on InitCastName1
  411.   set CastDeb to the number of cast "CastRef1"
  412.   repeat with compt = 1 to 10
  413.     set the name of cast (CastDeb + compt) to "C1_TitreM" & string(compt)
  414.     set the name of cast (CastDeb + compt + 10) to "C2_TitreM" & string(compt)
  415.     set the name of cast (CastDeb + compt + 20) to "PictTitre" & string(compt)
  416.     set the name of cast (CastDeb + compt + 30) to "Titre" & string(compt)
  417.     set the name of cast (CastDeb + compt + 40) to "Avis" & string(compt)
  418.     set the name of cast (CastDeb + compt + 50) to "Info" & string(compt)
  419.   end repeat
  420. end
  421.  
  422. on InitCastName2
  423.   set CastDeb to the number of cast "CastRef2" + 1
  424.   repeat with compt = 1 to 3
  425.     set the name of cast CastDeb to "B" & string(compt) & "_Avis"
  426.     set the name of cast (CastDeb + 1) to "B" & string(compt) & "_Visite"
  427.     set the name of cast (CastDeb + 2) to "B" & string(compt) & "_Oeil"
  428.     set the name of cast (CastDeb + 3) to "B" & string(compt) & "_Info"
  429.     set CastDeb to CastDeb + 4
  430.   end repeat
  431. end
  432.  
  433. on InitChamps
  434.   set Champs to EMPTY
  435.   set ChampsCast to "EffPictTitreMCD "
  436.   repeat with compt = 1 to 10
  437.     set Champs to Champs & string(compt + 10) & " "
  438.     set Champs to Champs & "C1_TitreM" & string(compt) & " "
  439.     set Champs to Champs & "C2_TitreM" & string(compt) & " "
  440.     set Champs to Champs & "R_Cliquez" & " "
  441.     set ChampsCast to ChampsCast & "C2_TitreM" & string(compt) & " "
  442.     set ChampsCast to ChampsCast & "1 "
  443.     set ChampsCast to ChampsCast & "AffPictTitreMCD(" & string(compt) & ") "
  444.   end repeat
  445.   put Champs
  446.   put ChampsCast
  447. end
  448.